// 员工的接口
import request from '@/utils/request'

// 获取员工列表
export const getEmplListApi = params => {
  return request.get('/sys/user', { params })
}

// 新增员工
export const addEmplApi = data => {
  return request.post('/sys/user', data)
}

// 获取员工基本信息
export const getEmplUserApi = id => {
  return request.get(`/sys/user/${id}`)
}

// 获取员工个人信息
export const getEmplUserInfoApi = id => {
  return request.get(`/employees/${id}/personalInfo`)
}

// 获取员工岗位信息
export const getEmplUserJobsApi = id => {
  return request.get(`/employees/${id}/jobs`)
}

// 修改员工基本信息
export const updataEmplApi = data => {
  return request.put(`/sys/user/${data.id}`, data)
}

// 批量导入员工
export const batchAddEmplApi = data => {
  return request.post('/sys/user/batch', data)
}

// 分配员工角色AssignRolesEmpl
export const AssignRolesEmplApi = data => {
  return request.put('/sys/user/assignRoles', data)
}

// 删除员工
export const delEmplApi = id => {
  return request.delete(`/sys/user/${id}`)
}
